<style type="text/css">
	.page-header .left {
		width: calc(100% - 220px);
	}

	@media only screen and (max-width: 479px) and (min-width: 320px) {
		.page-header .left {
			width: 100%;
		}
	}
</style>
<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['环卫管理','地磅数据验证']" icon="fa fa-cube"
			class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>地磅数据验证</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="page-header-btn">
								<sa-company-tree-car companyTreeId="searchcompanyTree" tcarNumberSelect2="searchCarNumberSelect2"
									wrapId="content" [isShowCarSort]="false" [isShowCarNum]="true"
									(companySelected)="searchCompanySelected($event)"></sa-company-tree-car>
								<div class="top_module">
									<span class="module_text">误差率</span>
									<select class="module_inp" name="errorRate" id="errorRate" [(ngModel)]="errorRate">
										<option value="">全部</option>
										<option value="1">≤10%</option>
										<option value="2">>10%</option>
									</select>
								</div>
								<div class="top_module">
									<span class="module_text">时间类型</span>
									<select class="module_inp" name="dateType" id="dateType" [(ngModel)]="dateType">
										<option value="0">收运开始时间</option>
										<option value="1">收运结束时间</option>
										<option value="2">上传时间</option>
									</select>
								</div>
								<div class="selectDate top_module">
									<div class="input-daterange input-group s_selected_time_box s_hover_box" data-date-format="dd-mm-yyy">
										<input type="text" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1"
											autocomplete="off" placeholder="选择开始时间" />
										<span class="s_selected_time_spe">至</span>
										<input type="text" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2"
											autocomplete="off" placeholder="选择结束时间" />
										<div class="s_del_icon" (click)='del_date()'>x</div>
									</div>
								</div>
								<!-- <div class="top_module top_module_box uploadDateTop">
                                    <span class="module_text">上传时间</span>
                                    <div class="s_hover_box">
                                        <input type="text" class="module_inp top_module_select form-control" id="uploadDate" autocomplete="off" [(ngModel)]="uploadDate" placeholder="上传时间"/>
                                        <div class="s_del_icon" (click)='del_uploadDate()'>x</div>
                                    </div>
                                </div> -->
								<div class="top_module cancle">
									<span class="module_text">上传人员</span>
									<input type="text" class="module_inp top_module_select ng-pristine ng-valid ng-touched"
										placeholder="上传人员" [(ngModel)]='uploadUser'>
									<div class="s_del_icon" (click)='delUserName()'>x</div>
								</div>
								<!-- <div class="top_module">
                                    <span class="module_text">上传人员</span>
                                    
									<div class="s_hover_box">
										<select   class="select2"  id="userNameSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delUserName()'>x</div>
									</div>
								</div> -->
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button type="button" class="btn btn-primary" (click)="importUp(weightModal)">导入</button>
								<button class="btn btn-primary" type="button" (click)="exportData()">导出</button>
								<button class="btn btn-primary" type="button" (click)="batchDelete()">批量删除</button>
							</div>
							<!-- <div class="right top-search">
                                <input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="设备ID、车牌号、录入人员...">
                                <span class="top-search-box">
                                    <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
                                </span>
                            </div> -->
						</div>
						<div class="table_scroll">
							<table
								class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>
											<div class="checkbox" style="margin:0;left: 5px;text-align: center;">
												<label>
													<input type="checkbox" class="checkbox style-0" [(ngModel)]="allChecked"
														(click)="allSelected()">
													<span></span>
												</label>
											</div>
										</th>
										<th>所属公司</th>
										<th>车牌号</th>
										<th>设备ID</th>
										<th>收运开始</th>
										<th>收运结束</th>
										<th>毛重时间</th>
										<th>皮重时间</th>
										<th>磅单净重[kg]</th>
										<th>平台净重[kg]</th>
										<th>误差[kg]</th>
										<th>误差率[%]</th>
										<th>平台桶数</th>
										<th>上传时间</th>
										<th>上传人员</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData; let i = index" (click)='rowSelected(row,$event,i)'>
										<td>
											<div class="checkbox" style="margin:0;left: 5px;text-align: center;">
												<label class="checkbox-label">
													<input type="checkbox" class="checkbox style-0" [(ngModel)]="row.isChecked"
														(click)='rowSelected(row,$event,i)'>
													<span class="checkbox-flag"></span>
												</label>
											</div>
										</td>
										<td>{{row.companyName}}</td>
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.transportStartDate}}</td>
										<td>{{row.transportEndDate}}</td>
										<td>{{row.hairWeightDate}}</td>
										<td>{{row.skinWeightDate}}</td>
										<td>{{row.weighbridgeNetWeight}}</td>
										<td>{{row.platformNetWeight}}</td>
										<td>{{row.errorValue}}
											<button *ngIf="row.isRFID" type="button" style="margin-left: 10px;"
												(click)="jumpPage('/langyun/huanding',row)" title="跳转单次称重明细[RFID]">查看明细</button>
											<button *ngIf="!row.isRFID" type="button" style="margin-left: 10px;"
												(click)="jumpPage('/langyun/single',row)" title="跳转单次称重明细">查看明细</button>
										</td>
										<td>
											<span style="color: red;" *ngIf="row.isErrorRateRed">{{row.errorRate.toFixed(2)}}</span>
											<span *ngIf="!row.isErrorRateRed">{{row.errorRate.toFixed(2)}}</span>
											<button type="button" style="margin-left: 10px;"
												(click)="jumpPage('/system-config/data-optimization',row)" title="跳转数据优化">分析处理</button>
										</td>
										<td>{{row.platformBucketsNum}}</td>
										<td>{{row.uploadDate}}</td>
										<td>{{row.uploadUser}}</td>
										<td>
											<button type="button" (click)="editRow(row,editModal)">编辑</button>
											<button type="button" class="" (click)='delRow(row)'>删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="tabletotalCount" [rows]="pageSize" [currentPage]="curPage - 1"
								(onPageChange)="tablePaginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i
									class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 导入弹窗-->
	<div bsModal #weightModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="cancelUp(weightModal)" aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title">上传Excel文件</h4>
				</div>
				<div class="modal-body">

					<div class="row">
						<form class="form form-inline " role="form">

							<div class="row" style="margin-bottom: 24px;">
								<div class="form-group module_line">
									<button type="button" class="btn btn-primary" (click)="load_module()">下载模板</button>
									<span class="row" class="note">注：请先下载模板，采用模板编辑文件后上传</span>
								</div>
							</div>


							<div class="row">
								<!--<label class="control-label col-sm-1" for="imgFile" style="padding: 0;display: inline-block;line-height: 32px;">文件</label>-->
								<div class="col-sm-10" style="padding: 0;">
									<div class="clearfix module_line">
										<button type="button" class="btn btn-primary" style="width: 120px;">上传模板文件
											<input type="file" class="up" (change)="fileChange($event.target.files)" name="fileToUpload"
												(click)='clearFile()' [(ngModel)]='fileUp' type="file" placeholder='' />
										</button>
										<span class="row" class="note">注：格式excel</span>
									</div>
								</div>
							</div>
							<div *ngIf="fileToUpload">
								<label class="control-label col-sm-1"></label>
								<div>
									<ul>
										<li class="file_list"><i class="fa fa-file-text-o"
												style="margin-right: 12px;"></i>{{fileToUpload.name}}<i class="fa fa-check-circle green"
												style="margin-left: 60px;"></i></li>
									</ul>
								</div>
							</div>
						</form>
					</div>

				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="cancelUp(weightModal)">取消</button>
					<button type="button" class="btn btn-primary" (click)="submitData(weightModal)">确认</button>
				</div>
			</div>
		</div>
	</div>
	<!--编辑行表格弹窗-->
	<section bsModal #editModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" aria-label="Close" (click)="cancelEdit(editModal)"><span
							aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">编辑地磅数据</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal " name="rowDataForm" id="rowDataForm" novalidate="novalidate"
						[saBootstrapValidator]="validatorOptions">
						<div class="form-group">
							<label class="control-label col-sm-3 no-padding-right">车牌号码<sup>*</sup></label>
							<div class="col-sm-9">
								<input type="text" class="form-control" name='carNumberInput' id="carNumberInput"
									[(ngModel)]='handleRow.carNumber' disabled>
								<!-- <input type="hidden"  class="form-control" name='carNumberInput' id="carNumberInput" [(ngModel)]='handleRow.carNumber'>
                            <div class="s_hover_box" style="width: 100%;">
                                <select   class="select2 form-control"  id="carNumberSelect2" style="width:100%" >
                                    <option value=''></option>
                                </select>
                                <div class="s_del_icon" (click)='del_carNumber2()'>x</div>
                            </div> -->
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3 no-padding-right">收运开始时间<sup>*</sup></label>
							<div class="col-sm-9">
								<div class="clearfix">
									<input class="form-control" name="transportStartDate" [(ngModel)]="handleRow.transportStartDate"
										placeholder="收运开始时间" type="text" id="transportStartDate" autocomplete="off" />
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3 no-padding-right">收运结束时间<sup>*</sup></label>
							<div class="col-sm-9">
								<div class="clearfix">
									<input class="form-control" name="transportEndDate" [(ngModel)]="handleRow.transportEndDate"
										placeholder="收运结束时间" type="text" id="transportEndDate" autocomplete="off" />
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-sm-3 no-padding-right">实际净重[kg]<sup>*</sup></label>
							<div class="col-sm-9">
								<div class="clearfix">
									<input class="form-control" name="weighbridgeNetWeight" [(ngModel)]="handleRow.weighbridgeNetWeight"
										placeholder="实际净重[kg]" type="text" />
								</div>
							</div>
						</div>
						<!-- <div class="form-group">
							<label class="control-label col-sm-3 no-padding-right">平台桶数<sup>*</sup></label>
							<div class="col-sm-9">
								<div class="clearfix">
									<input class="form-control" name="platformBucketsNum" [(ngModel)]="handleRow.platformBucketsNum"
										placeholder="平台桶数" type="text" />
								</div>
							</div>
						</div> -->
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="cancelEdit(editModal)">取消</button>
					<button type="button" class="btn btn-primary" (click)="editSubmit(editModal)">确认</button>
				</div>
			</div>
		</div>
	</section>
	<!--编辑行表格弹窗 弹窗-->
</div>